  <script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.5.min.js" type="text/javascript"></script>
  <script src="<?php bloginfo('template_directory'); ?>/js/jquery-ui-1.8.9.custom.min.js" type="text/javascript"></script>
  <script src="<?php bloginfo('template_directory'); ?>/js/jquery.easing.1.3.js" type="text/javascript"></script>
  <script src="<?php bloginfo('template_directory'); ?>/js/jquery.booklet.1.2.0.min.js" type="text/javascript"></script>

  <script>
    $(document).ready(function(){
      $("li.cat-item-"+<?php echo $parent[0]->term_id; ?>).parent().show();
      $("li.cat-item-"+<?php echo $parent[0]->term_id; ?>+" div").addClass("show");
    });
  </script>

  <script type="text/javascript">
  $(function() {
      $('#mybook').booklet({
          closed: true,
          autoCenter: true,
          width: 900,
          height: 400,
          manual: false,
          speed: 1000,
          pagePadding: 0,
          arrows: false,
          arrowsHide: false,
          pageNumbers: false
      });
  });
  </script>

  <div id="category-content" class="grid_10">
    <div id="category-title">
      <img src="<?php bloginfo('template_directory'); ?>/images/butterfly.png" />
      <h2><?php echo get_the_title(); ?></h2>
    </div>

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post();
      $args = array(
       'post_type' => 'attachment',
       'numberposts' => -1,
       'post_status' => null,
       'post_parent' => $post->ID
      );

      $attachments = get_posts( $args );
      if ( $attachments ) {

    ?>
	<div id="pdf-btn">
		<span>Click here to download PDF</span> <?php if (function_exists("wpptopdf_display_icon")) echo wpptopdf_display_icon();?>
	</div>
	
    <div id="post-content">

      

      <div id="mybook">
        <div class="b-load">
          <?php foreach ( $attachments as $attachment ) {
            //$image_attributes = wp_get_attachment_image_src($attachment->ID);
          ?>
          <!--<div><img src="<?php //echo $image_attributes[0]; ?>" /></div>-->
          <div><img src="<?php echo $attachment->guid; ?>" style="width:450px;height:400px;" /></div>
          <?php } ?>
        </div>
      </div><br />

      <p><?php echo $post->post_content; ?></p>
    </div>
    <?php
      }
      endwhile; endif; ?>

  </div>